<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Eatables.in - Your urban Restaurant Guide</title>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<link rel="shortcut icon" href="../images/favicon.ico" type="image/x-icon" />
<link rel="stylesheet" type="text/css" href="../css/originalcss.css" media="screen" />
<link rel="stylesheet" type="text/css" href="../css/maintemplate.css" media="screen" />
<link rel="stylesheet" type="text/css" href="../css/style.css" media="screen" />
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />

<script type="text/javascript" src="../js/jquery-1.3.2.js"></script>
<script type="text/javascript" src="../js/AC_RunActiveContent.js"></script>
<script type="text/javascript" src="../js/jquery.lavalamp.min.js"></script>
<script type="text/javascript" src="../js/jquery.easing.min.js"></script>
<script src="http://maps.google.com/maps?file=api&amp;v=2&amp;sensor=true&amp;key=ABQIAAAAToI_3ffe4vP0IAFsQUzioRT7NqV6lxNgcK9QOqZwZNVrUm3qMhSBNDwPtOXUrg8j1TUD1Bzvzku5IA" type="text/javascript"></script>
  </head>
  <body onunload="GUnload()">

    <div id="map" style="width: 550px; height: 450px"></div>
    <a href="store.htm">Back to the tutorial page</a>


    <noscript><b>JavaScript must be enabled in order for you to use Google Maps.</b> 
      However, it seems JavaScript is either disabled or not supported by your browser. 
      To view Google Maps, enable JavaScript by changing your browser options, and then 
      try again.
    </noscript>
 

    <script type="text/javascript">
    //<![CDATA[
    
    if (GBrowserIsCompatible()) {

      var lastmarker;
      var iwform = "<table>" +
                 "<tr><td>Name:</td> <td><input type='text' id='name'/> </td> </tr>" +
                 "<tr><td>Address:</td> <td><input type='text' id='address'/></td> </tr>" +
                 "<tr><td>Type:</td> <td><select id='type'>" +
                 "<option value='bar' SELECTED>bar</option>" +
                 "<option value='restaurant'>restaurant</option>" +
                 "</select> </td></tr>" +
                 "<tr><td></td><td><input type='button' value='Save & Close' onclick='process(this)'/></td></tr>";


      function createInputMarker(point) {
        var marker = new GMarker(point,{draggable:true, icon:G_START_ICON});
        GEvent.addListener(marker, "click", function() {
          lastmarker = marker;
          marker.openInfoWindowHtml(iwform);
        });
        map.addOverlay(marker);
        marker.openInfoWindowHtml(iwform);
        lastmarker=marker;
        return marker;
      }

      function createMarker(point,text) { 
        var marker = new GMarker(point);
        GEvent.addListener(marker,"click", function() {
          marker.openInfoWindow(document.createTextNode(text));
        });
        map.addOverlay(marker);
        return marker;
      }

      var map = new GMap2(document.getElementById("map"),{draggableCursor:"default"});
      map.addControl(new GLargeMapControl());
      map.addControl(new GMapTypeControl());
      map.setCenter(new GLatLng(17.4178504943848,78.4505767822266),13);
      GEvent.addListener(map,"click",function(overlay,point){
        if (!overlay) {
          createInputMarker(point);
        }
      });

      function process(form) {
      var name = escape(document.getElementById("name").value);
      var address = escape(document.getElementById("address").value);
      var type = document.getElementById("type").value;
     var lat = lastmarker.getPoint().lat();
        var lng = lastmarker.getPoint().lng();
 
        
       var url = "../IKnow?name=" + name + "&address=" + address +
                "&type=" + type + "&lat=" + lat + "&lng=" + lng;
	   var details="Name:"+name+"<br> Address:"+address+"<br> Thank you!!";


        GDownloadUrl(url, function(doc) {    });  

        map.closeInfoWindow();
        var marker = createMarker(lastmarker.getPoint(),details);
        GEvent.trigger(marker,"click");

      }  

    }
    else {
      alert("Sorry, the Google Maps API is not compatible with this browser");
    }
    </script>
  </body>

</html>




